<template>
    <div class="bottom-nav">
        <el-menu mode="horizontal" :default-active="activePath" class="nav-menu" @select="handleSelect">
            <el-menu-item index="/teacher">成绩管理</el-menu-item>
            <el-menu-item index="/course">课程管理</el-menu-item>
        </el-menu>
    </div>
</template>

<script setup>
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const activePath = route.path

const handleSelect = (index) => {
    if (index !== route.path) {
        router.push(index)
    }
}
</script>

<style scoped>
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -2px 8px 0 rgba(64, 158, 255, 0.06);
    z-index: 100;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    width: 100%;
    border-bottom: none;
    justify-content: center;
}
</style>